﻿using System;
using System.Collections.Generic;
using System.Configuration;
using System.Data.SqlClient;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;

public partial class Register : System.Web.UI.Page
{
    SqlConnection con = new SqlConnection(ConfigurationManager.ConnectionStrings["connectionString"].ConnectionString);
    SqlCommand com;
    protected void Page_Load(object sender, EventArgs e)
    {

    }
    protected void btnRegister_Click(object sender, EventArgs e)
    {
        con.Open();
        string strRegister = "insert into StudentAccount(stu_username, stu_password,stu_fullname,stu_studentcode,ad_email) values ('" + txtUsername.Text.Trim() + "','" + txtPassword.Text.Trim() + "','" + txtFullname.Text.Trim() + "','" + txtStudentCode.Text.Trim() + "','" + txtEmail.Text.Trim() + "')";
        com = new SqlCommand(strRegister, con);
        com.ExecuteNonQuery();
        con.Close();
        lblMsgLogin.Text = "Register Successful!";
    }
}